package cn.spike.system.service.impl;

import cn.spike.basic.service.impl.BaseServiceImpl;
import cn.spike.system.domain.SystemDictionaryType;
import cn.spike.system.mapper.SystemDictionaryDetailMapper;
import cn.spike.system.mapper.SystemDictionaryTypeMapper;
import cn.spike.system.service.SystemDictionaryTypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author:spike
 * @create:2023-02-01 22:01
 */
@Service
public class SystemDictionaryTypeServiceImpl extends BaseServiceImpl<SystemDictionaryType> implements SystemDictionaryTypeService {

    @Autowired
    private SystemDictionaryTypeMapper systemDictionaryTypeMapper;

    @Autowired
    private SystemDictionaryDetailMapper systemDictionaryDetailMapper;

    @Override
    public void delete(Long id) {
        systemDictionaryDetailMapper.deleteByTypesId(id);
        super.delete(id);
    }

    @Override
    public void patchDelete(List<Long> ids) {
        systemDictionaryDetailMapper.patchDeleteByTypesId(ids);
        super.patchDelete(ids);
    }
}
